import controller.BlogController;
import controller.UserController;
import view.AdminView;
import view.MainView;
import view.UserView;

public class Main {
    public static void main(String[] args) {
        // 先创建所有需要的对象
        BlogController blogController = new BlogController();
        UserView userView = new UserView();
        UserController userController = new UserController();
        MainView mainView = new MainView();
        AdminView adminView = new AdminView();

        // 依赖注入（互相绑定）
        blogController.setUserView(userView);
        userView.setBlogController(blogController);
        userView.setUserController(userController);
        userController.setUserView(userView);
        userController.setAdminView(adminView);
        mainView.setUserController(userController);
        adminView.setBlogController(blogController);

        // 启动主界面
        mainView.start();
    }
}
